﻿using System;

public class Mapper011 : MapperDefault
{
    public override void init(NES nes)
    {
        base.init(nes);
    }

    public override void write(int address, short value_Renamed)
    {
        if (address < 0x8000)
        {
            base.write(address, value_Renamed);
        }
        else
        {
            int bank = ((value_Renamed & 15) * 2) % base.nes.Rom.RomBankCount;
            int num2 = (((value_Renamed & 15) * 2) + 1) % base.nes.Rom.RomBankCount;
            this.loadRomBank(bank, 0x8000);
            this.loadRomBank(num2, 0xc000);
            if (base.rom.VromBankCount > 0)
            {
                int num3 = ((value_Renamed >> 4) * 2) % base.nes.Rom.VromBankCount;
                this.loadVromBank(num3, 0);
                this.loadVromBank(num3 + 1, 0x1000);
            }
        }
    }
}

